<?php
namespace App\Http\Controllers\User\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class LogoutController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth:user');
    }

    public function logout(Request $request)
    {
        $this->guard()->logout();
        return redirect()->route('user.login');
    }

    protected function guard()
    {
        return Auth::guard('user');
    }
}
